#ifndef _LED_H_
#define _LED_H_

#include <stdint.h>

#ifndef HIGH
#define HIGH 1
#endif

#ifndef LOW
#define LOW 0
#endif

#ifndef LED_ON
#define LED_ON 1
#endif

#ifndef LED_OFF
#define LED_OFF 0
#endif

typedef struct led {
	struct {
		struct {
			/* led 是高电平点亮还是低电平点亮 */
			int level;
		} fix;
		struct {
			int res;
		} var;
	} cfg;
	struct {
		void (*gpio_set_val)(int val);
	} ops;
	struct {
		/* 当前 LED 状态是点亮还是熄灭 */
		int state;
	} priv;
} led_t;

int led_on(led_t* led);
int led_off(led_t* led);
int led_turn(led_t* led);

#endif
